# from parse.case_parser import case_parser
#
#
# class CasePlugin:
#     """自定义插件"""
#     def pytest_addoption(self,parser):
#         """
#         增加pytest运行的配置项
#         :param parser:
#         :return:
#         """
#         parser.addoption("--type",action = "store",default = "yaml",help="测试用例类型")
#         parser.addoption("--cases", action="store", default="./cases_yaml", help="测试用例目录")
#
#     def pytest_generate_tests(self,metafunc):
#         """
#         主要用来生成测试用例的，相当于参数化
#         :param metafunc:
#         :return:
#         """
#         case_type = metafunc.config.getoption("type")
#         case_dir = metafunc.config.getoption("cases")
#
#         data = case_parser(case_type,case_dir)
#
#         if "caseinfo" in metafunc.fixturenames:
#             metafunc.parametrize("caseinfo",data)